package priv.bestbeat.cloud.common.utils;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

/**
 * @author 张渠钦
 * @date 2021/12/8 17:00
 */
public final class JacksonUtil {

    private static final ObjectMapper objectMapper;

    static {
        // 初始化 jackson
        objectMapper = new ObjectMapper();
        objectMapper.registerModule(new JavaTimeModule());
    }

    /**
     * 常用Jackson
     * @return
     */
    public static ObjectMapper commonJackson() {
        return objectMapper;
    }

}
